import hashlib
import json
from time import time

class Blockchain(object):
    def __init__(self):
        # 整个区块链
        self.chain = []
        # 现有的还没有写入区块链的交易信息
        self.current_transactions = []
        #添加创世区块
        self.new_block(previous_hash = 1 , proof = 100 )

    def new_block(self , proof , previous_hash=None):

        # Creates a new Block and adds it to the chain
        # 产生一个新的区块并写入区块链


    def new_transaction(self , sender , recipient , amount ):




        # 往列表中添加相关数据
        self.current_transactions.append({
            'sender' : sender,
            'recipient' : recipient ,
            'amount' : amount
        })

        #返回这笔交易将要在的区块
        return self.last_block['index'] + 1

    @staticmethod
    def hash(block):
        # Hashes a Block
        #计算这个区块的Hash
        pass

    @property
    def last_block(self):
        # Returns the last Block in the chain
        #返回这个链的最后一个区块
        pass


